Willem Ottevanger

15 Reputation

2 Badges

12 years, 142 days

MaplePrimes Activity


These are replies submitted by Willem Ottevanger

In my case that doesnt work as I wanted to perform a Taylor expansion on q depending on f. 
Or is there a neater way to do this?
> restart;
> q := cos(f(x)^2);
/ 2\
cos\f(x) /
> p := subs(f(x) = f, q);
/ 2\
cos\f /
> t := taylor(%, f = 0, 5);
1 4 / 8\
1 - - f + O\f /
2
> restart;

> q := cos(f(x)^2);
/ 2\
cos\f(x) /
> alias(f = f(x));
f
> taylor(q, f = 0, 5);
%;
Error, invalid input: taylor received f(x) = 0, which is not valid for its 2nd argument, eqn
In my case that doesnt work as I wanted to perform a Taylor expansion on q depending on f. 
Or is there a neater way to do this?
> restart;
> q := cos(f(x)^2);
/ 2\
cos\f(x) /
> p := subs(f(x) = f, q);
/ 2\
cos\f /
> t := taylor(%, f = 0, 5);
1 4 / 8\
1 - - f + O\f /
2
> restart;

> q := cos(f(x)^2);
/ 2\
cos\f(x) /
> alias(f = f(x));
f
> taylor(q, f = 0, 5);
%;
Error, invalid input: taylor received f(x) = 0, which is not valid for its 2nd argument, eqn

Thanks for your answer

Thanks for your answer

Oh turns out subs can help me out as follows
> p := f(x)^2+g(x)^3;
> q := subs(f(x) = f, g(x) = g, p);
Page 1 of 1